/**
 * 提交查询
 * @return
 */
function searchMembersSubmit() {
	var spara = $("#memberListFrm").serialize();
	doActionNoCallback("core", $("#memberListFrm").get(0).action, spara);
}

/**
 * 添加账号
 * @return
 */
function addMemberSubmit() {
	var spara = $("#addMemberFrm").serialize();
	doActionNoCallback("core", $("#addMemberFrm").get(0).action, spara);
}

function popMemberModifyDiv(id) {
	doActionNoPar("memberPopWindow", appServer + "/back/member/getMember.htm?memberId=" + id, function() {
		popupDiv("memberModifyPopDiv");
	}, null);
}

function memberModifySubmit() {
	alert($("#mobilePhone").val());
	$.ajax({
	    type: "POST",
	    url: appServer + "/back/member/memberModify.htm",
	    data : {"memberId": $("#memberId").val(), "mobilePhone": $("#mobilePhone").val()},
	    dataType: "json",
	    success: function(result) {
	       if (result.success) {
	    	   alert("操作成功");
	    	   hideDiv('memberModifyPopDiv');
	       } else {
	    	   alert(result.errorMsg)
	       }
	    }
	});
}

function popUpdateStockDiv(id, name) {
	doActionNoPar("memberPopWindow", appServer + "/back/member/gotoUpdateItemsStockPage.htm?memberId=" + id +"&memberName=" + name, function() {
		popupDiv("batchUpdateItemsStockPopDiv");
	}, null);
}

function updataItemsStockSubmit(id) {
	$("#batchUpdateItemsStockMsg").html("<h2>文件解析中，请稍候... </h2>");
	$.ajaxFileUpload({
		method:"POST",
	    url: appServer + "/back/item/batchUpdateItemsStock.htm",
	    secureuri:true,
	    fileElementId:'file',                        //文件选择框的id属性 
        data:{memberId:id},
        dataType: 'JSON',
        success: function(data){
        	$("#batchUpdateItemsStockMsg").html("<h2>商品更新成功</h2>");
//        	alert(data);
//        	if (data) {
// 	    	  $("#batchUpdateItemsStockMsg").html("<h2>"+ data.data +"</h2>");
// 	       } else {
// 	    	  $("#batchUpdateItemsStockMsg").html("<h2><font color='#FF0000'>文件解析失败</font></h2>");
// 	       }
        },error: function (data, status, e){ 
        	$("#batchUpdateItemsStockMsg").html("<h2><font color='#FF0000'>文件解析失败</font></h2>");
//        	$("#batchUpdateItemsStockMsg").html("<h2>"+ e +"</h2>");
        } 
	});
	return false;
}
